home *** CD-ROM | disk | FTP | other *** search
/ BMUG PD-ROM BV3 / BMUG PD-ROM Version BV3 (CDRM1097900).iso / HyperCard / Business / ScheduleStack / LocalStack / LocalStack / card_5204.txt < prev    next >
Text File  |  1990-01-07  |  5KB  |  216 lines

  1. -- card: 5204 from stack: in
  2. -- bmap block id: 7997
  3. -- flags: 0000
  4. -- background id: 3073
  5. -- name: Cleanup
  6. ----- HyperTalk script -----
  7. on openCard
  8.   global OneDay
  9.   put the date into Today
  10.   convert Today to seconds
  11.   put 30 * OneDay into OneMonth
  12.   convert (Today - OneMonth) to long date
  13.   put it into cd field KillDate
  14. end openCard
  15.  
  16.  
  17.  
  18. -- part 1 (button)
  19. -- low flags: 00
  20. -- high flags: A006
  21. -- rect: left=79 top=62 right=108 bottom=248
  22. -- title width / last selected line: 0
  23. -- icon id / first selected line: 0 / 0
  24. -- text alignment: 1
  25. -- font id: 0
  26. -- text size: 12
  27. -- style flags: 0
  28. -- line height: 16
  29. -- part name: Remove
  30. ----- HyperTalk script -----
  31. on mouseUp
  32.   set the hilite of cd button "Save in stack" to false
  33. end mouseUp
  34.  
  35.  
  36.  
  37. -- part 2 (button)
  38. -- low flags: 00
  39. -- high flags: A006
  40. -- rect: left=79 top=127 right=173 bottom=248
  41. -- title width / last selected line: 0
  42. -- icon id / first selected line: 0 / 0
  43. -- text alignment: 1
  44. -- font id: 0
  45. -- text size: 12
  46. -- style flags: 0
  47. -- line height: 16
  48. -- part name: Save in stack
  49. ----- HyperTalk script -----
  50. on mouseUp
  51.   set the hilite of button "Remove" to true
  52.   if the hilite of me is true then
  53.     set lockText of cd field "Destination" to false
  54.   else set lockText of cd field "Destination" to true
  55. end mouseUp
  56.  
  57.  
  58. -- part 3 (button)
  59. -- low flags: 00
  60. -- high flags: E006
  61. -- rect: left=79 top=192 right=238 bottom=248
  62. -- title width / last selected line: 0
  63. -- icon id / first selected line: 0 / 0
  64. -- text alignment: 1
  65. -- font id: 0
  66. -- text size: 12
  67. -- style flags: 0
  68. -- line height: 16
  69. -- part name: Compact Stack
  70.  
  71.  
  72. -- part 4 (field)
  73. -- low flags: 00
  74. -- high flags: 0004
  75. -- rect: left=130 top=97 right=118 bottom=361
  76. -- title width / last selected line: 0
  77. -- icon id / first selected line: 0 / 0
  78. -- text alignment: 1
  79. -- font id: 0
  80. -- text size: 12
  81. -- style flags: 0
  82. -- line height: 16
  83. -- part name: KillDate
  84.  
  85.  
  86. -- part 5 (field)
  87. -- low flags: 01
  88. -- high flags: 0004
  89. -- rect: left=130 top=160 right=181 bottom=361
  90. -- title width / last selected line: 0
  91. -- icon id / first selected line: 0 / 0
  92. -- text alignment: 1
  93. -- font id: 0
  94. -- text size: 12
  95. -- style flags: 0
  96. -- line height: 16
  97. -- part name: Destination
  98.  
  99.  
  100. -- part 6 (button)
  101. -- low flags: 00
  102. -- high flags: A003
  103. -- rect: left=100 top=257 right=279 bottom=200
  104. -- title width / last selected line: 0
  105. -- icon id / first selected line: 0 / 0
  106. -- text alignment: 1
  107. -- font id: 0
  108. -- text size: 12
  109. -- style flags: 0
  110. -- line height: 16
  111. -- part name: OK
  112. ----- HyperTalk script -----
  113. on mouseUp
  114.   push card
  115.   put the short name of this stack into ThisStack
  116.   put empty into cd field ToRemove
  117.   if the hilite of button Remove is true then
  118.     set lockscreen to true
  119.     -- if cards are being archived, check that the destination exists
  120.     if the hilite of cd button "Save in Stack" is true then
  121.       put cd field "Destination" into Destination
  122.       if Destination is empty then
  123.         answer "Need to know where to save them!"
  124.         exit mouseUp
  125.       end if
  126.       go stack Destination
  127.       if the result is not empty then
  128.         answer "Need to create the stack"
  129.         exit mouseUp
  130.       end if
  131.       go back
  132.     end if
  133.     set the cursor to busy
  134.     if the hilite of cd button "Save in stack" is true
  135.     then put TRUE into Save
  136.   else put FALSE into Save
  137.   put cd field "KillDate" into KillDate
  138.   convert KillDate to seconds
  139.   -- collect the ids of the cards to be removed
  140.   repeat with i = 1 to the number of cards
  141.     go card i
  142.     put the short name of this card into ThisCard
  143.     convert ThisCard to seconds
  144.     if the result is empty then
  145.       if ThisCard < KillDate then
  146.         put the number of lines of cd field ToRemove of cd CleanUp into LastLine
  147.         put the short id of this cd into line (LastLine + 1) of cd field ToRemove of cd CleanUp
  148.       end if
  149.     end if
  150.   end repeat
  151.   go card CleanUp
  152.   -- now remove the cards
  153.   put the number of lines of cd field ToRemove into NumCardsToRemove
  154.   repeat with i = 1 to NumCardsToRemove
  155.     go card CleanUp of stack ThisStack
  156.     go card id (line i of cd field ToRemove)
  157.     domenu "Cut Card"
  158.     if Save is TRUE then
  159.       go stack Destination
  160.       domenu "Paste Card"
  161.       go back
  162.     end if
  163.   end repeat
  164. end if
  165. go card CleanUp of stack ThisStack
  166. if the hilite of button "Compact Stack" is true then
  167.   set the cursor to busy
  168.   domenu "Compact Stack"
  169. end if
  170. play sax temp 50 "a g "
  171. answer "All Done!"
  172. visual effect iris close
  173. pop card
  174. end mouseUp
  175.  
  176.  
  177.  
  178.  
  179.  
  180. -- part 7 (button)
  181. -- low flags: 00
  182. -- high flags: A003
  183. -- rect: left=290 top=257 right=279 bottom=390
  184. -- title width / last selected line: 0
  185. -- icon id / first selected line: 0 / 0
  186. -- text alignment: 1
  187. -- font id: 0
  188. -- text size: 12
  189. -- style flags: 0
  190. -- line height: 16
  191. -- part name: Cancel
  192. ----- HyperTalk script -----
  193. on mouseUp
  194.   visual effect iris close
  195.   go back
  196. end mouseUp
  197.  
  198.  
  199.  
  200. -- part 8 (field)
  201. -- low flags: 80
  202. -- high flags: 0002
  203. -- rect: left=392 top=26 right=306 bottom=508
  204. -- title width / last selected line: 0
  205. -- icon id / first selected line: 0 / 0
  206. -- text alignment: 0
  207. -- font id: 3
  208. -- text size: 9
  209. -- style flags: 0
  210. -- line height: 12
  211. -- part name: ToRemove
  212.  
  213.  
  214. -- part contents for card part 4
  215. ----- text -----
  216. Friday, December 8, 1989